/**
 * 
 */
package br.com.ac.fatureweb.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import br.com.ac.fatureweb.integration.enums.EnumStatus;
import br.com.ac.fatureweb.utilitary.Model;

/**
 * @author aldivone
 *
 */
@Entity
@Table(name = "EQUIPAMENTO")
@SequenceGenerator(name = "SEQ_EQUIPAMENTO", sequenceName = "SEQ_EQUIPAMENTO", allocationSize = 1, initialValue = 1)
public class Equipamento extends Model {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3280782817982997750L;

	@Id
	@GeneratedValue(generator = "SEQ_EQUIPAMENTO", strategy = GenerationType.SEQUENCE)
	@Column(name = "ID")
	private Long id;

	@Column(name = "CHIP")
	private String chip;

	@Column(name = "SERIAL")
	private String serial;

	@Column(name = "IMEI", unique = true)
	private String imei;

	@Column(name = "NUMERO")
	private String numero;

	@Column(name = "STATUS")
	@Enumerated(EnumType.ORDINAL)
	private EnumStatus status;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DATA_CADASTRO")
	private Date dataCadastro;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DATA_INATIVACAO")
	private Date dataInativacao;

	@ManyToOne(optional = false)
	@JoinColumn(name = "ID_LEITURISTA", referencedColumnName = "ID")
	private Leiturista leiturista;

	public Equipamento() {
		super();
	}

	public Equipamento(Long id) {
		super();
		this.id = id;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Equipamento(Long id, String chip, String serial, String imei,
			String numero, EnumStatus status, Date dataCadastro,
			Date dataInativacao, Leiturista leiturista) {
		super();
		this.id = id;
		this.chip = chip;
		this.serial = serial;
		this.imei = imei;
		this.numero = numero;
		this.status = status;
		this.dataCadastro = dataCadastro;
		this.dataInativacao = dataInativacao;
		this.leiturista = leiturista;
	}

	public String getChip() {
		return chip;
	}

	public void setChip(String chip) {
		this.chip = chip;
	}

	public String getSerial() {
		return serial;
	}

	public void setSerial(String serial) {
		this.serial = serial;
	}

	public String getImei() {
		return imei;
	}

	public void setImei(String imei) {
		this.imei = imei;
	}

	public String getNumero() {
		return numero;
	}

	public void setNumero(String numero) {
		this.numero = numero;
	}

	public EnumStatus getStatus() {
		return status;
	}

	public void setStatus(EnumStatus status) {
		this.status = status;
	}

	public Date getDataCadastro() {
		return dataCadastro;
	}

	public void setDataCadastro(Date dataCadastro) {
		this.dataCadastro = dataCadastro;
	}

	public Date getDataInativacao() {
		return dataInativacao;
	}

	public void setDataInativacao(Date dataInativacao) {
		this.dataInativacao = dataInativacao;
	}

	public Leiturista getLeiturista() {
		return leiturista;
	}

	public void setLeiturista(Leiturista leiturista) {
		this.leiturista = leiturista;
	}

}
